import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
import styles from './index.module.less'

export default class extends Component {

    constructor(props) {
        super(props)
    }


    render() {
        const { title = '测试数据', price = 29.9, subTitle = [{ name: '学习', value: '238次' }, { name: '时间', value: '2019-12-28' }] } = this.props;
        return (
            <View className={styles.mediaInfo}>
                <View className={styles.price}>￥{price}</View>
                <View className={styles.mediaInfoTitle}>{title}</View>
                {/* <View className={styles.mediaInfoPrice}>¥{price}</View> */}
                {
                    subTitle.map(
                        item => (
                            <View className={styles.mediaInfoSubTitle} key={item.name}>
                                <View className={styles.subTitleFirstItem}>{item.name}</View>
                                <View className={styles.subTitleSecondItem}>{item.value}</View>
                            </View>
                        )
                    )
                }
            </View>
        )
    }
}
